<script setup lang="ts">
import{ ref, defineProps } from 'vue'
const props = defineProps({
    types:{
        type:String,
        default:'1'
    },
    title:{
        type:String,
        default:'学习专区'
    }
})
const backClick = ()=>{
    uni.navigateBack({
        delta:1
    })
}
const searchClick = ()=>{
    uni.navigateTo({
        url:'search'
    })
}
</script>
<template>
  <view class="header">
    <!-- <view></view> -->
    <image v-if="types == '1'" class="img" src="../static/logo.png" alt="" />
    <view v-else style="display: flex; flex-direction: row;">
        <image @click="backClick" class="imgIcon1" src="../static/back.png" alt="" />
        <image @click="searchClick" class="imgIcon" src="../static/search.png" alt="" />
        <view class="fontTitle">{{title}}</view>
    </view>
    
  </view>
</template>

<style lang="scss">
.header{
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  height: 88px;
  background: #fff;
  .img {
    width: 160px; 
    height: 24px;
    padding: 54px 0 0 15px;
  }
  .fontTitle{
    padding: 54px 0 0 85px;
  }
  .imgIcon1{
    width: 12px;
    height: 12px;  
    padding: 58px 0 0 15px;
  }
  .imgIcon{
    width: 20px;
    height: 20px;  
    padding: 54px 0 0 15px;
  }
}
</style>
